package com.ctrip.constant;

/**
 * 0全部 1待抢单 2被抢 3已抢 4已过期 5已取消
 */
public enum OrderStatusEnum {
    ALL("0"),
    WAITING("1"),
    GRABED_BY_OTHER("2"),
    GRABED_BY_SELF("3"),
    EXPIRED("4"),
    CANCELED("5");


    private String type;

    OrderStatusEnum(String type) {
        this.type = type;
    }

    public static OrderStatusEnum find(String type){
        for (OrderStatusEnum orderStatusEnum : OrderStatusEnum.values()) {
            if(orderStatusEnum.getType().equals(type)){
                return orderStatusEnum;
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }
}
